package com.huangj.pro2_h2pop;

import android.content.Intent;
import android.view.View;
import android.widget.TextView;

import com.huangj.adapter.HomeInfoRoteAdapter;
import com.huangj.entity.HomeInfoEntity;
import com.huangj.huangjlibrary.base.BaseActivity;
import com.huangj.wedigt.MyListview;

import java.util.List;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by HuangJ on 2016/10/5.16:12
 */
public class JDRoteMapActivity extends BaseActivity {

    private HomeInfoEntity.DataBean.SectionsBean.ModelsBean models;
    private HomeInfoRoteAdapter homeInfoRoteAdapter;

    @BindView(R.id.tv_rotetop)
    TextView tv_rotetop;
    @BindView(R.id.tv_rotepicbottom)
    TextView tv_rotebottom;
    @BindView(R.id.lv_rotelv)
    MyListview roteListView;
    @Override
    protected int getContentId() {
        return R.layout.jdrote_layout;
    }


    @Override
    protected void init() {
        Intent intent = getIntent();
        models = (HomeInfoEntity.DataBean.SectionsBean.ModelsBean) intent.getSerializableExtra("models");
//        Log.d("print", "init: "+models.getTitle());
        overridePendingTransition(R.anim.bottom_in,R.anim.bottomout);
        tv_rotetop.setText(models.getTitle());
        tv_rotebottom.setText(models.getDays_count()+"天");
        //天数集合；
        List<HomeInfoEntity.DataBean.SectionsBean.ModelsBean.DaysBean> days = models.getDays();
        homeInfoRoteAdapter = new HomeInfoRoteAdapter(this);
        homeInfoRoteAdapter.setDatas(days);
        roteListView.setAdapter(homeInfoRoteAdapter);
    }


    @OnClick(R.id.iv_roteback)
    public  void onClick(View view){
        this.finish();
}

}
